package com.example.vote.flow.mapper;

import com.example.vote.flow.pojo.entity.VoteRecord;
import com.example.vote.flow.pojo.vo.VoteRecordVO;

import java.time.LocalDate;
import java.util.List;

public interface VoteRecordMapper {
    int insert(VoteRecord voteRecord);

    int deleteById(Long id);

    int countByVoteTopicIdAndIpAddress(Long voteTopicId, String ipAddress);

    int countByVoteTopicIdAndUserId(Long voteTopicId, Long userId);

    int countByVoteTopicIdAndUserIdAndVoteDate(Long voteTopicId, Long userId, LocalDate voteDate);

    VoteRecordVO selectById(Long id);

    List<VoteRecordVO> selectByVoteOptionId(Long voteOptionId);
}